Home > biomechZoo > Toolbox > Support Functions > barweb.m

barweb

PURPOSE ^

SYNOPSIS ^

function handles = barweb(barvalues, errors, width, groupnames, bw_title, bw_xlabel, bw_ylabel, bw_colormap, gridstatus, bw_legend, error_sides, legend_type)

DESCRIPTION ^

 Usage: handles = barweb(barvalues, errors, width, groupnames, bw_title, bw_xlabel, bw_ylabel, bw_colormap, gridstatus, bw_legend, error_sides, legend_type)

 Ex: handles = barweb(my_barvalues, my_errors, [], [], [], [], [], bone, [], bw_legend, 1, 'axis')

 barweb is the m-by-n matrix of barvalues to be plotted.
 barweb calls the MATLAB bar function and plots m groups of n bars using the width and bw_colormap parameters.
 If you want all the bars to be the same color, then set bw_colormap equal to the RBG matrix value ie. (bw_colormap = [1 0 0] for all red bars)
 barweb then calls the MATLAB errorbar function to draw barvalues with error bars of length error.
 groupnames is an m-length cellstr vector of groupnames (i.e. groupnames = {'group 1'; 'group 2'}).  For no groupnames, enter [] or {}
 The errors matrix is of the same form of the barvalues matrix, namely m group of n errors.
 Gridstatus is either 'x','xy', 'y', or 'none' for no grid.
 No legend will be shown if the legend paramter is not provided
 'error_sides = 2' plots +/- std while 'error_sides = 1' plots just + std
 legend_type = 'axis' produces the legend along the x-axis while legend_type = 'plot' produces the standard legend.  See figure for more details

 The following default values are used if parameters are left out or skipped by using [].
 width = 1 (0 < width < 1; widths greater than 1 will produce overlapping bars)
 groupnames = '1', '2', ... number_of_groups
 bw_title, bw_xlabel, bw_ylabel = []
 bw_color_map = jet
 gridstatus = 'none'
 bw_legend = []
 error_sides = 2;
 legend_type = 'plot';

 A list of handles are returned so that the user can change the properties of the plot
 handles.ax: handle to current axis
 handles.bars: handle to bar plot
 handles.errors: a vector of handles to the error plots, with each handle corresponding to a column in the error matrix
 handles.legend: handle to legend


 See the MATLAB functions bar and errorbar for more information

 Author: Bolu Ajiboye
 Created: October 18, 2005 (ver 1.0)
 Updated: Dec 07, 2006 (ver 2.1)
 Updated: July 21, 2008 (ver 2.3)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sun 10-Mar-2024 22:39:06 by m2html © 2005